/**
 * Created by Xuelei.kong on 2016/7/2.
 */
function showTime(){
    var show_day=new Array('星期一','星期二','星期三','星期四','星期五','星期六','星期日');
    var time=new Date();
    var year=time.getFullYear();
    var month=time.getMonth()+1;
    var date=time.getDate();
    var day=time.getDay();
    var hour=time.getHours();
    var minutes=time.getMinutes();
    var second=time.getSeconds();
    month=month<10?"0"+month:month;
    date=date<10?"0"+date:date;
    hour<10?hour='0'+hour:hour;
    minutes<10?minutes='0'+minutes:minutes;
    second<10?second='0'+second:second;
    var now_time= year+'年'+month+'月'+date+'日'+' '+show_day[day-1];
    var time=hour+':'+minutes+':'+second;
    document.getElementById('date').innerHTML=now_time;
    document.getElementById('time').innerHTML=time;
    setTimeout("showTime();",1000);
}
showTime();
// 指定图表的配置项和数据

optionZhnhMonth = {
    title: {
        text: '',
        textStyle:{
            color:"#fff"
        }
    },
    color:[
        "#e5004f","#5fb9a1"
    ],
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        data: ['本月', '上月'],
        textStyle:{
            color:"#fff"
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type: 'category',
        data: ['1','2','3','4','5','6'],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }

    },
    yAxis: {
        type: 'value',
        boundaryGap: [0, 0.01],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }
    },
    series: [
        {
            name: '本月',
            type: 'bar',
            data: [1, 2, 3, 4, 5, 6],
            barWidth:"6"
        },
        {
            name: '上月',
            type: 'bar',
            data: [2, 3, 2, 4, 5, 6],
            barWidth:"6"
        }
    ]
};
optionZhnhYear = {
    title: {
        text: '',
        textStyle:{
            color:"#fff"
        }
    },
    color:[
        "#e5004f","#5fb9a1"
    ],
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        data: ['去年', '今年'],
        textStyle:{
            color:"#fff"
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type: 'category',
        data: ['1','2','3','4','5','6'],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }

    },
    yAxis: {
        type: 'value',
        boundaryGap: [0, 0.01],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }
    },
    series: [
        {
            name: '去年',
            type: 'bar',
            data: [1, 2, 3, 4, 5, 6],
            barWidth:"6"
        },
        {
            name: '今年',
            type: 'bar',
            data: [2, 3, 2, 4, 5, 6],
            barWidth:"6"
        }
    ]
};

optionCpdhMonth = {
    title: {
        text: '',
        textStyle:{
            color:"#fff"
        }
    },
    color:[
        "#e5004f","#5fb9a1"
    ],
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        data: ['本月', '上月'],
        textStyle:{
            color:"#fff"
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type: 'category',
        data: ['1','2','3','4','5','6'],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }

    },
    yAxis: {
        type: 'value',
        boundaryGap: [0, 0.01],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }
    },
    series: [
        {
            name: '本月',
            type: 'bar',
            data: [1, 2, 3, 4, 5, 6],
            barWidth:"6"
        },
        {
            name: '上月',
            type: 'bar',
            data: [2, 3, 2, 4, 5, 6],
            barWidth:"6"
        }
    ]
};
optionCpdhYear = {
    title: {
        text: '',
        textStyle:{
            color:"#fff"
        }
    },
    color:[
        "#e5004f","#5fb9a1"
    ],
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        data: ['去年', '今年'],
        textStyle:{
            color:"#fff"
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type: 'category',
        data: ['1','2','3','4','5','6'],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }

    },
    yAxis: {
        type: 'value',
        boundaryGap: [0, 0.01],
        axisLine:{
            lineStyle:{
                color:"#fff"
            }
        }
    },
    series: [
        {
            name: '去年',
            type: 'bar',
            data: [1, 2, 3, 4, 5, 6],
            barWidth:"6"
        },
        {
            name: '今年',
            type: 'bar',
            data: [2, 3, 2, 4, 5, 6],
            barWidth:"6"
        }
    ]
};

optionCjyd = {
    backgroundColor:"#114855",
    title : {
        x:'center',
        left:"50%",
        top:10,
        textAlign:"center",
        text: '',
        textStyle:{
            color:"#fff"
        }
    },

    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },

    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : ['车间一','车间二','车间三','车间四','车间五','车间六','车间七'],
            axisLine:{
                lineStyle:{
                    color:"#fff",
                    width:2
                }
            }
        }
    ],
    yAxis : [
        {
            name:"元",
            type : 'value',
            axisLine:{
                lineStyle:{
                    color:"#fff",
                    width:2
                }
            }
        }
    ],
    series : [
        {
            name:'直接访问',
            type:'bar',
            data:[320, 332, 301, 334, 390, 330, 320],

            itemStyle: {
                normal:{
                    color:"#a62258"
                },
                emphasis: {
                    color:"#a62258"
                }
            }
        }

    ]
};
    var myChartZhnhMonth = echarts.init(document.getElementById('zhnh_month'));
myChartZhnhMonth.setOption(optionZhnhMonth);

var myChartZhnhYear = echarts.init(document.getElementById('zhnh_year'));
myChartZhnhYear.setOption(optionZhnhYear);

if(document.getElementById('cjyd')){
    if(document.getElementById('cjyd')){
        var myChartDht = echarts.init(document.getElementById('cjyd'));
// 使用刚指定的配置项和数据显示图表。
        myChartDht.setOption(optionCjyd);
    }
}


var myChartCpdhMonth = echarts.init(document.getElementById('cpdh_month'));
myChartCpdhMonth.setOption(optionCpdhMonth);

var myChartCpdhYear = echarts.init(document.getElementById('cpdh_year'));
myChartCpdhYear.setOption(optionCpdhYear);
